<?php

global $confirmType;
global $actionType;
global $organizationType;
	$year= date('Y');
	$month= date('m');
	$date= date('d');
	
//return;
?>
	<div class="block">

	<div class="invertedshiftdown">
<ul>
	<?php
	if($organization->type=='s'){
	?>
			<li><a href="?page=organization_inventory&id=<?php echo $organization->id; ?>">查看货存</a></li>
			<li><a href="?page=organization_sell&id=<?php echo $organization->id; ?>">出售</a></li>
			<li><a href="?page=organization_return&id=<?php echo $organization->id; ?>">退款</a></li>
			<li><a href="?page=organization_distribute&id=<?php echo $organization->id; ?>">分配</a></li>
			<li><a href="?page=organization_distribute_confirm&id=<?php echo $organization->id; ?>">处理待定分配</a></li>
			<li><a href="?page=organization_transaction&id=<?php echo $organization->id; ?>">查看物流记录</a></li>
			<li class="current"><a href="?page=organization_sell_record&id=<?php echo $organization->id; ?>">查看销售记录</a></li>
			<li><a href="?page=organization_consume&id=<?php echo $organization->id; ?>">报告损耗/遗失</a></li>
			<li><a href="?page=organization_count&id=<?php echo $organization->id; ?>">货存盘点</a></li>
	<?php
	}elseif($organization->type=='w'){
	?>
	       	<li><a href="?page=organization_inventory&id=<?php echo $organization->id; ?>">查看库存</a></li>
			<li><a href="?page=organization_stack&id=<?php echo $organization->id; ?>">入库</a></li>
			<li><a href="?page=organization_distribute&id=<?php echo $organization->id; ?>">分配</a></li>
			<li><a href="?page=organization_distribute_confirm&id=<?php echo $organization->id; ?>">处理待定分配</a></li>
			<li><a href="?page=organization_transaction&id=<?php echo $organization->id; ?>">查看物流记录</a></li>
			<li><a href="?page=organization_consume&id=<?php echo $organization->id; ?>">报告损耗/遗失</a></li>
			<li><a href="?page=organization_count&id=<?php echo $organization->id; ?>">货存盘点</a></li>
    <?php
	}
	?>
</ul>




<form id="myform">
<input type="text" class="textinput" /> <input class="submit" type="submit" value="搜索" />
</form>
</div>

<br style="clear: both;" />
<div id= 'content'>

	<div class="isa_info">
		<h4><?php echo $message ?></h4><?php echo $condition ?>
	</div>
		<h2><?php echo $organization->name ?>》销售记录显示》销售状况(数量/时间)</h2>
 
	<script type="text/javascript" src="js/jsapi.js"></script>

  <script type="text/javascript">

    google.load('visualization', '1', {packages: ['annotatedtimeline']});
    function drawVisualization() {
      var data = new google.visualization.DataTable();
      <?php
      echo  "data.addColumn('date', 'Date');";
      echo  "data.addColumn('number', '退款次数');\n";
      echo  "data.addColumn('number', '售出次数');\n";
      echo  "data.addColumn('number', '退款件数');\n";      
      echo  "data.addColumn('number', '售出件数');\n";
	  echo "data.addRows([";
	  $result="";
	  while($row = mysql_fetch_array($lineCurve))
      {
   	     $time=$row['sale_date'];
   	      	
			$date1=date('Y,n,j', strtotime($time." -1 month"));
			
			 $return_case=$row['return_case'];
			 $sell_case=$row['sell_case'];
			 $return_number=$row['return_number'];
			 $sell_number=$row['sell_number'];
   	      	$result.=" [new Date($date1), $return_case, $sell_case,$return_number,$sell_number],";
   	     
		  
     }
	  if($result!=""){
		 $result=substr($result,0,-1);
		}
	  echo $result."]);";
	  //echo "]);";
      ?>
      
    
      var annotatedtimeline = new google.visualization.AnnotatedTimeLine(
          document.getElementById('visualization'));
     annotatedtimeline.draw(data, {'displayAnnotations': true});
    }
    
    google.setOnLoadCallback(drawVisualization);
  </script>

    <div id="visualization" style="width: 1000px; height: 800px;"></div>

	<br><br>
	<table class="optionTable">
		<tr ><td class="left">
		<h4>按条件搜索</h4>
		
		 <form action="" method="post">
		 	<input type='hidden' name='option' value='_s_report_daterange_org_by_date_number'>
			 <div style="clear:both;">
             <div class="element">
				<label class="form">交易日期</label>
 			</div>
 			<div style="clear:both;">
  			<li>
			<label>
				从
			</label>
			<span>
				<select name="fromYear">
					<?php
					for($i = 2009; $i <= 2020; $i++){
						if($year==$i){
						 echo "<option value='$i' selected>$i</option>";
						}else{
						 echo "<option value='$i'>$i</option>";		
							
						}
					}
					?>
				</select>
				 <label for="Field103">年</label>
				</span>
				<span class="symbol">/</span>
				<span>
				<select name="fromMonth">
					<?php
					for($i = 1; $i <= 12; $i++){
						if($i<10){
					   		$i="0".$i;
						}
					 if($month==$i){
						 echo "<option value='$i' selected>$i</option>";
						}else{
						 echo "<option value='$i'>$i</option>";		
						}
					}
					?>
				</select><label for="Field103-1">月</label>
				</span> 
				<span class="symbol">/</span>
				<span>
				<select name="fromDate">
					<?php
				   for($i = 1; $i <= 31; $i++){
				   	if($i<10){
					   		$i="0".$i;
						}
					   if($date==$i){
						 echo "<option value='$i' selected>$i</option>";
						}else{
						 echo "<option value='$i'>$i</option>";		
						}
					}
					?>
				</select>
				<label for="Field103-2">日</label>
				</span>
			</li>

 			 <li>
				<label>
					到
				</label>
				<span>
	
					
					<select name="toYear">
						<?php
						for($i = 2009; $i <= 2020; $i++){
							if($year==$i){
							 echo "<option value='$i' selected>$i</option>";
							}else{
							 echo "<option value='$i'>$i</option>";		
								
							}
						}
						?>
					</select>
					 <label for="Field103">年</label>
					</span>
					<span class="symbol">/</span>
					<span>
					<select name="toMonth">
						<?php
						for($i = 1; $i <= 12; $i++){
							if($i<10){
						   		$i="0".$i;
							}
						 if($month==$i){
							 echo "<option value='$i' selected>$i</option>";
							}else{
							 echo "<option value='$i'>$i</option>";		
								
							}
						}
						?>
					</select><label for="Field103-1">月</label>
					</span> 
					<span class="symbol">/</span>
					<span>
					<select name="toDate">
						<?php
						for($i = 1; $i <= 31; $i++){
							if($i<10){
						   		$i="0".$i;
							}
						   if($date==$i){
						   
							 echo "<option value='$i' selected>$i</option>";
								
							}else{
							
							 echo "<option value='$i'>$i</option>";		
							}
						}
						?>
					</select>
					<label for="Field103-2">日</label>
					</span>
					
					
					
					</li>
   </div>
                <div style="clear:both;">

    
   <br>
   <div class="element">
<input type="submit" value="递交" />
        <div class="loading"></div>
    				</div>
    			</form>
    		</td>
    		<td class="mid">
    			<center>
					<img border="0" src="images/table1.png" width="270" height="200">
					<div>
					<form action="" method="post">
						<input type='submit' value="销售状况/详细">
					</form></div>
    			</center>
    		</td>
    		<td class="right">
    			<center >
					<img border="0" src="images/line1.png" width="270" height="200">
					<br>
					<form action="" method="post">
						<input type='hidden' name='option' value='_s_report_daterange_org_by_date_amount'>
						<input type='submit' value="销售状况(金额/时间)">
					</form>
    			</center>
    		</td>
    	</tr>
    </table>

<br>
<br>
<br>


   
<div class="clear"></div>
	</div>